package com.ruoyi.news.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.news.domain.XcxWalletInfo;
import com.ruoyi.news.domain.XxcWallet;
import com.ruoyi.news.mapper.XxcWalletMapper;
import com.ruoyi.news.service.IXcxWalletInfoService;
import com.ruoyi.news.service.IXxcWalletService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 小程序-钱包Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-29
 */
@Service
public class XxcWalletServiceImpl implements IXxcWalletService
{
    @Autowired
    private XxcWalletMapper xxcWalletMapper;

    @Autowired
    private IXcxWalletInfoService xcxWalletInfoService;

    /**
     * 查询小程序-钱包
     * 
     * @param id 小程序-钱包主键
     * @return 小程序-钱包
     */
    @Override
    public XxcWallet selectXxcWalletById(String id)
    {
        return xxcWalletMapper.selectXxcWalletById(id);
    }

    @Override
    public XxcWallet selectXxcWalletByUserId(String userId) {
        return xxcWalletMapper.selectXxcWalletByUserId(userId);

    }

    /**
     * 查询小程序-钱包列表
     * 
     * @param xxcWallet 小程序-钱包
     * @return 小程序-钱包
     */
    @Override
    public List<XxcWallet> selectXxcWalletList(XxcWallet xxcWallet)
    {
        return xxcWalletMapper.selectXxcWalletList(xxcWallet);
    }

    /**
     * 新增小程序-钱包
     * 
     * @param xxcWallet 小程序-钱包
     * @return 结果
     */
    @Override
    public int insertXxcWallet(XxcWallet xxcWallet)
    {
        xxcWallet.setCreateTime(DateUtils.getNowDate());
        return xxcWalletMapper.insertXxcWallet(xxcWallet);
    }

    /**
     * 修改小程序-钱包
     * 
     * @param xxcWallet 小程序-钱包
     * @return 结果
     */
    @Override
    public int updateXxcWallet(XxcWallet xxcWallet)
    {
        xxcWallet.setUpdateTime(DateUtils.getNowDate());
        return xxcWalletMapper.updateXxcWallet(xxcWallet);
    }

    /**
     * 批量删除小程序-钱包
     * 
     * @param ids 需要删除的小程序-钱包主键
     * @return 结果
     */
    @Override
    public int deleteXxcWalletByIds(String[] ids)
    {
        return xxcWalletMapper.deleteXxcWalletByIds(ids);
    }

    /**
     * 删除小程序-钱包信息
     * 
     * @param id 小程序-钱包主键
     * @return 结果
     */
    @Override
    public int deleteXxcWalletById(String id)
    {
        return xxcWalletMapper.deleteXxcWalletById(id);
    }
}
